package com.youlai.boot.gym.converter;

import com.youlai.boot.common.model.Option;
import com.youlai.boot.system.model.entity.Role;
import org.mapstruct.Mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.gym.model.entity.ClassTypes;
import com.youlai.boot.gym.model.form.ClassTypesForm;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * 课程类型对象转换器
 *
 * @author hxc
 * @since 2025-06-01 10:41
 */
@Mapper(componentModel = "spring")
public interface ClassTypesConverter{


    @Mappings({
            @Mapping(target = "value", source = "classTypeId"),
            @Mapping(target = "label", source = "typeName")
    })
    Option<Long> toOption(ClassTypes type);

    List<Option<Long>> toOptions(List<ClassTypes> typeList);
    ClassTypesForm toForm(ClassTypes entity);

    ClassTypes toEntity(ClassTypesForm formData);
}